<?php
class Modules_Common_DB_Users extends BaseObject
{
	public static function GetTableName() {
        return 'users';
    }
    public static function &ById($id) {
        self::GetById($id);
    }
    public static function &ByEmail($email)
    {
    	$mcdu=new Modules_Common_DB_Users();
    	if(count(($ids=$mcdu->GetIds('WHERE email="'.Mysql::EscapeString($email).'"')))==1)
        	return $mcdu->GetByIds($ids);
        else
        	return null;
    }
 	public function validatePassword($password)
 	{
 		if($this->password==md5($password))
 			return true;
 		else
 			return false;
 	}   
 
}